/*
 * This provides a simple way to access the global version number of the
 * Mask library. Whenever creating a new library for distribution update
 * the version tag and add a symbolic label to cvs:
 *
 *   update the version number in this file.
 *   make (also updates the .tex file).
 *   darcs record
 *   darcs tag libMaskVx_yz
 *
 * The "$Version: ...$" construct is needed so that "ident" can show the
 * current version number. The routine returns the version with "$Version:
 * ...$" part stripped, so that it can be used to print the version number
 * by calling "libMaskVersion".
 *
 * Copyright (c) 2006-2010 Xaveer Leijtens
 *
 * This file is part of libMask.
 *
 * libMask is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * libMask is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with libMask.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <string.h>

char *libMaskVersion()
{
    static char version[] = "$Version: Masklib V6_00 $";
    static int len = 0;

    if (!len) {
        len = strlen(version) - 2;      /* Position of last ' '.       */
        version[len] = 0;               /* NULL replacing last ' '.    */
    }
    return(&version[10]);               /* Strip '$Version: '.         */
}
